package cn.goktech.controller;

import cn.goktech.bean.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.servlet.http.HttpServletRequest;

@Controller
public class ParamsController {
    @RequestMapping("/getUserId")
    public String getUserId(HttpServletRequest request){
        String id = request.getParameter("id");
        System.out.println("id="+id);
        return "success";
    }

    @RequestMapping("/getUser")
    public String getUser(User user){
        System.out.println(user);
        return "success";
    }
    @RequestMapping("/getParams")
    public String getParams(Integer id,String name){
        System.out.println("id="+id);
        System.out.println("name="+name);
        return "success";

    }
    @RequestMapping("/getParams2")
    public String getParams2(@RequestParam("ids") Integer id, @RequestParam("names") String name){
        System.out.println("id="+id);
        System.out.println("name="+name);
        return "success";

    }

}
